home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 2: CDPD 1
/
Almathera Ten on Ten - Disc 2: CDPD 1.iso
/
pd
/
351-375
/
359
/
dice
/
dice.lzh
/
lib
/
amiga
/
exit.c
< prev
next >
Wrap
C/C++ Source or Header
|
1990-04-20
|
704b
|
56 lines
/*
* EXIT.C
*
* (c)Copyright 1990, Matthew Dillon, All Rights Reserved
*/
#include <stdio.h>
#include <lib/atexit.h>
#include <libraries/dosextens.h>
typedef struct Process Process;
extern long *__MemList;
extern void *_WBMsg;
AtExit *_ExitBase;
void
exit(code)
int code;
{
{
AtExit *eb;
for (eb = _ExitBase; eb; eb = eb->Next)
(*eb->Func)();
}
fclose(stdin);
fclose(stdout);
fclose(stderr);
/*
* stdio
*/
while (_Iod)
fclose(_Iod);
/*
* file descriptors
*/
__closeall();
/*
* low level exit (handles allocated memory & workbench)
*/
if (_WBMsg) {
Forbid();
ReplyMsg(_WBMsg);
}
_exit(code);
}